app._player = null;

app.units = {};

app.UnitsMgr = {
	_types : {},
	
	createUnit : function(type) {
		if (typeof type != 'object') {
			type = this.getType(type);
		}
		
		return $.extend(true, {}, app.base.unit, type);
	},
	
	getType : function(type) {
		return this._types[type];
	}
};

app.base.unit = {
	name : '',
	damage : 0,
	health : 0,
	
	getDamage : function() {
		return this.damage;
	},
	
	isDead : function() {
		return this.health <= 0;
	}
};

(function() {
	var types = {
		'base' : {
			damage : 1,
			health : 10
		},
		'player' : {
			base : 'base',
			health : 50,
			name : 'Player'
		}
	};
	
	for (var id in types) {
		
	}
})();